<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2016 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------

//总公司
use think\Route;

$super_manager_prefix = 'super';//总公司
$manager_prefix = 'manager';//营地
$manager_prefix_branch = 'branch';//分公司
$web_prefix = 'www';
$user_prefix = 'user';//会员
$wx_prefix = 'wx';//微信
$api_prefix = 'api';//数据接口

/**
 * 后台路由营地
 */
Route::domain($manager_prefix, function(){
    Route::rule('/','manager/Index/index');
    Route::controller('campmanager','manager/CampManager');
    Route::rule('campmanagerlist/delete','manager/CampManagerList/delete');
    Route::resource('campmanagerlist','manager/CampManagerList');
    Route::rule('campmanagerlist/luck','manager/CampManagerList/luck');
    Route::rule('campmanagerlist/unluck','manager/CampManagerList/unluck');
    Route::resource('camp','manager/Camp');
    Route::rule('camp/getcity','manager/Camp/getCity');
    Route::rule('camp/getcountry','manager/Camp/getCountry');
    Route::rule('camp/getprovince','manager/Camp/getProvince');
    Route::rule('camp/imgupload','manager/Camp/imgUpload');
    //验证图片
   	Route::get('captcha/[:id]', "\\think\\captcha\\CaptchaController@index");
    Route::controller('managerinfo','manager/ManagerInfo');
    Route::resource('camptype','manager/CampType');
    Route::resource('campgrade','manager/CampGrade');
    Route::controller('user','manager/User');
    //房车类型
    Route::resource('carcate','manager/CarCate');
    //房车国别
    Route::resource('carcountry','manager/CarCountry');
    //房车厂家
    Route::resource('carrender','manager/CarRender');
    //房车品牌
    Route::resource('carbrand','manager/CarBrand');
    //驾照类型
    Route::resource('drivertype','manager/DriverType');
    //房车
    Route::resource('caravan','manager/Caravan');
    Route::rule('caravan/price','manager/Caravan/price');
    Route::rule('caravan/postPrice','manager/Caravan/postPrice');
    Route::rule('caravan/create_m','manager/Caravan/create_m');
    Route::rule('caravan/getCountry','manager/Caravan/getCountry');
    Route::rule('caravan/getProvince','manager/Caravan/getProvince');
    Route::rule('caravan/getCity','manager/Caravan/getCity');
    Route::rule('caravan/getCamp','manager/Caravan/getCamp');
    Route::rule('caravan/postUploadImg','manager/Caravan/postUploadImg');
    //车系
    Route::resource('cartpl','manager/CarTpl');
    //卡
    Route::controller('card','manager/Card');
    
    Route::controller('superuser','manager/SuperUser');
    Route::controller('ajax','manager/Ajax');
    Route::controller('intergrate','manager/Intergrate');
    //营地现金流水
    Route::controller('cash','manager/Cash');
  	//订单管理
  	Route::controller('orders','manager/Order');
});
/**
 * 后台路由分公司
 */
Route::domain($manager_prefix_branch, function(){
    //分公司管理员
    Route::rule('manager/:id/readinfo','branch/Manager/getReadInfo');
    Route::rule('/','branch/Manager/getLogin');
    Route::controller('manager','branch/Manager');
    //分公司会员管理
    Route::rule('usercontrol/:id/readinfo','branch/Usercontrol/getReadInfo');
    Route::controller('usercontrol','branch/Usercontrol');
    //分公司房车管理
    Route::rule('caravancontrol/:id/readinfo','branch/Caravancontrol/getReadInfo');
    Route::controller('caravancontrol','branch/Caravancontrol');
    //分公司营地管理
    Route::rule('campcontrol/:id/addcampmanager','branch/Campcontrol/getAddCampManager');
    Route::rule('campcontrol/:id/readinfo','branch/Campcontrol/getReadInfo');
    Route::rule('campcontrol/:id/editinfo','branch/Campcontrol/getEditInfo');
    Route::controller('campcontrol','branch/Campcontrol');
    Route::get('captcha/[:id]', "\\think\\captcha\\CaptchaController@index");
    //分公司旅行币流水
    Route::controller('intergrate','branch/Intergrate');
    //分公司现金流水
    Route::controller('cash','branch/Cash');
    //订单管理
	 Route::controller('orders','branch/Order');
});


/**
 * 会员中心路由
 */
Route::domain($user_prefix, function(){
  Route::controller('user','user/User');
  Route::get('captcha/[:id]', "\\think\\captcha\\CaptchaController@index");
  //会员找回密码
  Route::controller('userforgotpwd','user/UserForgotPwd');
  //会员个人资料
  Route::controller('userinfo','user/UserInfo');
  //会员联系人
  Route::rule('contactinfo/:id/del','user/ContactInfo/delete');
  Route::resource('contactinfo','user/ContactInfo');
  //会员房车信息
  //Route::rule('caravaninfo/:id/del','user/CaravanInfo/delete');
  Route::controller('caravaninfo','user/CaravanInfo');
  //房车设置
  Route::controller('setcaravan','user/SetCaravan');
  //旅行币
  Route::controller('intergrate','user/Intergrate');
  //现金
  Route::controller('cash','user/Cash');
  //订单
  Route::controller('order','user/Order');
  Route::controller('test','user/Payment');
  //会员消息路由
  Route::controller('message','user/Message');
  //会员心愿
  Route::controller('wishs','user/Wish');
  //底部资讯
  Route::controller('about','user/About');
  //心愿订单
  Route::controller('wishorders','user/WishOrder');
});

/**
 * 前台路由
 */
Route::domain($web_prefix, function(){
    //验证图片
    Route::get('captcha/[:id]', "\\think\\captcha\\CaptchaController@index");
    //reserve预定流程
    Route::controller('reserve','index/Reserve');
    //filter筛选流程
    Route::controller('filter','index/Filter');
    //订单路由
    Route::controller('order','index/Order');
    //网站杂项
    Route::controller('web','index/Web');
    //底部资讯
    Route::controller('about','user/About');
    Route::rule('/','index/Web/index');
    //心愿
    Route::controller('wishs','user/Wish');
});

/**
 * 其他路由
 */
Route::domain($wx_prefix, function(){
    Route::controller('test','user/Order');
    Route::controller('wxpay','user/Payment');
    Route::controller('index','wxapi/Index');
    Route::controller('user','wxapi/User');
    Route::controller('order','wxapi/Order');
    Route::rule('qrcodes/[:data]', 'user/Qrcodes/index');
    Route::controller('test','wxapi/Test');
});
/**
 * 其他路由
 */
Route::domain($api_prefix, function(){
    Route::controller('order', 'api/Order');
    Route::controller('test','test/Index');
    Route::controller('share','api/Share');
    Route::resource('token', 'api/User', ['var'=>['token'=>'token']]);
    Route::resource('setting','superManager/Setting');
});

//总公司后台路由
Route::domain($super_manager_prefix, function(){
	//登录页路由
	Route::controller('manager','superManager/Manager');
	Route::rule('/','superManager/Manager/getLogin');
	//验证图片
	Route::get('captcha/[:id]', "\\think\\captcha\\CaptchaController@index");
	
	//首页路由
	Route::rule('index','superManager/Index/index');
	//管理员设置路由
	Route::resource('managerset','superManager/ManagerSet');
	Route::controller('managersetinfo','superManager/ManagerSet');
	
	Route::rule('del','superManager/ManagerSet/del');
	Route::rule('setManagerStatus','superManager/ManagerSet/setManagerStatus');
	//管理员找回密码路由
	Route::controller('managerfotgot','superManager/ManagerForgotPwd');
	Route::rule('managerfotgot','superManager/ManagerForgotPwd/getIndex');
	
	//分公司路由
	Route::resource('filiale','superManager/Filiale');
	//分公司管理员
	Route::resource('filialemanagers','superManager/FilialeManager');
	
	//营地类型
	Route::resource('types','superManager/CampType');
	//营地星级
	Route::resource('grades','superManager/CampGrade');
	//驾照类型
	Route::resource('drivertypes','superManager/DriverType');
	//房车国别
	Route::resource('countries','superManager/CarCountry');
	//车型
	Route::resource('cates','superManager/CarCate');
	//厂家
	Route::resource('renders','superManager/CarRender');
	//品牌
	Route::resource('brands','superManager/CarBrand');
	
	//营地管理
	Route::resource('camps','superManager/Camp');
	Route::rule('camps/notPass/:id/','superManager/Camp/notPass');
	Route::rule('camps/getcity','superManager/Camp/getCity');
	Route::rule('camps/getcountry','superManager/Camp/getCountry');
	Route::rule('camps/getprovince','superManager/Camp/getProvince');
	
	//分公司房车管理
	Route::rule('caravans/sethot/:id/:hot','superManager/Caravan/setHot');
	Route::resource('caravans','superManager/Caravan');
	
	//会员管理
  Route::rule('users/rzlist','superManager/User/RZList');
  Route::rule('users/rzinfo','superManager/User/RZInfo');
  Route::rule('users/rzpass','superManager/User/RZPass');
	Route::resource('users','superManager/User');
	
	//图片上传
	Route::rule('uploadimg','superManager/UploadImg/postIndex');
	Route::rule('uploadueditor','superManager/UploadImg/getIndex');
	//ajax
	Route::controller('ajax','superManager/Ajax');
	//订单管理
	Route::controller('orders','superManager/Order');
	//退回押金
	Route::controller('quitdeposits','superManager/QuitDeposit');
	//后台旅行币流水
	Route::controller('intergrates','superManager/Intergrate');
	//提现
	Route::controller('cashs','superManager/GetCash');

  //企业动态新闻
  Route::rule('news/delete','superManager/News/delete');
  Route::resource('news','superManager/News');
  
  //旅行币与人民币兑换
   Route::resource('setting','superManager/Setting');
});

